package com.gljx.web.service.impl;

import com.gljx.web.Entity.StudentPhoto;
import com.gljx.web.dao.StudentPhotoMapper;
import com.gljx.web.service.StudentPhotoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class StudentPhotoServiceImpl implements StudentPhotoService  {

	@Autowired
	private StudentPhotoMapper studentPhotoMapper;

	/**
	 * 插入学员头像
	 */
	@Override
    public synchronized void insertPhoto(StudentPhoto studentPhoto) {
		// TODO Auto-generated method stub
		studentPhotoMapper.insertSelective(studentPhoto);
	}
	
	/**
	 * 根据学员ID查询头像
	 */
	@Override
	public StudentPhoto selectStudentPhotoByStudentId(String fid) {
		// TODO Auto-generated method stub
		return studentPhotoMapper.selectStudentPhotoByStudentId(fid);
	}

	@Override
	public void deleteByFstudentId(String[] fids) {
		studentPhotoMapper.deleteByFstudentId(fids);
	}

	@Override
	public void update(StudentPhoto studentPhoto) {
		studentPhotoMapper.updateByPrimaryKeyWithBLOBs(studentPhoto);
	}

}
